@extends('layouts.buz.layout', ['header_active' => 'member'])
@section('sidebar')
    @include('layouts.buz.sidebar.member', ['active' => 'info'])
@endsection()
@section('title')
    个人中心 - 基本信息
@endsection()
@section('content')
    {{--个人中心--}}
    <div class="panel panel-default">
        <div class="panel-heading">
            <h4 class="panel-title">
                基本信息
                <button type="button" class="btn btn-default right" data-toggle="modal" data-target="#myModal">修改</button>
            </h4>
        </div>
        <div class="panel-body">
            <form class="form-horizontal member" role="form" id="userInfoList">

            </form>

        </div>
    </div>

    @endsection()
@section('dialog')
{{--弹出框--}}
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body textC">
                <h5 class="fontSize1">修改基本信息，请联系客服:QQ {{implode(',', config('app.website.CONTACT_QQ'))}}</h5>
            </div>
            <div class="modal-footer textC">
                <button type="button" class="btn btn-primary" data-dismiss="modal">关闭</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
@endsection()
@section('bottom_js')
    <script src="{{asset('js/buz/template-web.js')}}"></script>
    <script id="userInfoM" type="text/html">
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label for="" class="col-sm-3 control-label">认证性质</label>
                    <div class="col-sm-8">
                        @{{ if property == 0}}
                        <label class="radio-inline">
                            <input type="radio" id="uncompany" name="property" value="0" checked disabled>&nbsp;个人
                        </label>
                        @{{ /if}}
                        @{{ if property == 1}}
                        <label class="radio-inline">
                            <input type="radio" id="company" name="property" value="1" checked disabled>&nbsp;企业
                        </label>
                        @{{ /if}}
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label for="" class="col-sm-3 control-label">商户性质</label>
                    <div class="col-sm-8">
                        @{{ if role == 0}}
                        <label class="radio-inline">
                            <input type="radio" name="role" value="0" checked disabled>&nbsp;商户
                        </label>
                        @{{ /if}}
                        @{{ if role == 1}}
                        <label class="radio-inline">
                            <input type="radio" name="role" value="1" checked disabled>&nbsp;代理
                        </label>
                        @{{ /if}}

                    </div>
                </div>
            </div>
        </div>
        <hr />

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label for="" class="col-sm-3 control-label">真实姓名</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="realname" id="realname" value="@{{ realname }}" disabled/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label for="" class="col-sm-3 control-label">身份证号</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="idcard" id="idcard" value="@{{ idcard }}" disabled/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label for="" class="col-sm-3 control-label">通讯地址</label>

                    <div class="col-sm-4">
                        <input class="form-control" type="text" id="SelProvince" value="@{{ city.province }}"disabled/>

                    </div>
                    <div class="col-sm-4">
                        <input class="form-control" type="text" name="city_id" id="SelCity" value="@{{ city.city }}"disabled/>
                    </div>

                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label for="" class="col-sm-3 control-label">经营范围</label>

                    <div class="col-sm-4">
                        <input class="form-control" type="text" id="SelBusiType" value="@{{ buz_scope.parent_name }}" disabled/>
                    </div>
                    <div class="col-sm-4">
                        <input class="form-control" type="text" id="SelBusiSubType" value="@{{ buz_scope.name }}" disabled/>
                    </div>

                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label for="" class="col-sm-3 control-label">地址</label>
                    <div class="col-sm-8">
                        <input class="form-control"  id="address" name="address" value="@{{ address }}" type="text" disabled/>
                    </div>
                </div>
            </div>
        </div>
        @{{ if status==2 }}
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label for="" class="col-sm-3 control-label">反馈</label>
                    <div class="col-sm-8">
                        <input class="form-control"  id="remark" name="remark" value="@{{ remark }}" type="text" disabled/>
                    </div>
                </div>
            </div>
        </div>
        @{{ /if }}
        @{{ if property== 1 }}
        <div class="row companyAttr" >
            <div class="col-sm-6">
                <div class="form-group">
                    <label for="" class="col-sm-3 control-label">公司名称</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="enterprise" id="enterprise" value="@{{ enterprise }}" disabled/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label for="" class="col-sm-3 control-label">营业执照号</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="license" id="license" value="@{{ license }}" disabled/>
                    </div>
                </div>
            </div>
        </div>
        @{{ /if }}
        <hr>
        <div class="mage_div">
            <div class="row">
                <div class="col-sm-4">
                    <div class="y-upload-img yhy-popover" data-toggle="popover" data-placement="right"
                         data-content="<ul class='popover-width'><li>身份证上的<span class='text-danger'>所有信息清晰可见</span>，必须能<span class='text-danger'>看清证件号码</span>。</li><li>照片需免冠，建议未化妆，手持证见人的<span class='text-danger'>五官清晰可见</span>。</li><li>照片内容真实有效，不得做任何修改</li><li>支持<span class='text-danger'>.jpg .jpeg .bmp .gif</span>格式照片大小<span class='text-danger'>不超过2M</span></li></ul>">
                        {{--<h1 class="y-mt60"><small>请选择文件</small></h1>--}}
                        <img src="@{{ img_id_hand }}" class="upload-img"/>
                        {{--<input type="file" value="" name="img_id_hand" style="opacity: 0" class="fileValue"/>--}}
                        {{--<input type="file" value="" name="image" class="inputImg"id="img_id_hand"/>--}}
                    </div>
                    <h4 class="y-fs16">手持证件照片</h4>
                    {{--<button type="button" class="btn btn-link" y-click="infopicone">示例图片</button>--}}
                </div>
                <div class="col-sm-4">

                    <div class="y-upload-img yhy-popover" data-toggle="popover" data-placement="right"
                         data-content="<ul class='popover-width'><li>身份证上的<span class='text-danger'>所有信息清晰可见</span>，必须能<span class='text-danger'>看清证件号码</span>。</li><li>照片需免冠，建议未化妆，手持证见人的<span class='text-danger'>五官清晰可见</span>。</li><li>照片内容真实有效，不得做任何修改</li><li>支持<span class='text-danger'>.jpg .jpeg .bmp .gif</span>格式照片大小<span class='text-danger'>不超过2M</span></li></ul>">
                        {{--<h1 class="y-mt60"><small>请选择文件</small></h1>--}}
                        <img src="@{{ img_id_front }}" class="upload-img"/>
                        {{--<input type="file" value="" name="img_id_front" class="inputImg"/>--}}
                    </div>
                    <h4 class="y-fs16">身份证正面照</h4>

                    {{--<button type="button" class="btn btn-link" y-click="infopicone">示例图片</button>--}}

                </div>
                <div class="col-sm-4">
                    <div class="y-upload-img yhy-popover" data-toggle="popover" data-placement="right"
                         data-content="<ul class='popover-width'><li>身份证上的<span class='text-danger'>所有信息清晰可见</span>，必须能<span class='text-danger'>看清证件号码</span>。</li><li>照片需免冠，建议未化妆，手持证见人的<span class='text-danger'>五官清晰可见</span>。</li><li>照片内容真实有效，不得做任何修改</li><li>支持<span class='text-danger'>.jpg .jpeg .bmp .gif</span>格式照片大小<span class='text-danger'>不超过2M</span></li></ul>">
                        {{--<h1 class="y-mt60"><small>请选择文件</small></h1>--}}
                        <img src="@{{ img_id_back }}" class="upload-img"/>
                        {{--<input type="file" value="" name="img_id_back" class="inputImg"/>--}}
                    </div>
                    <h4 class="y-fs16">身份证背面照</h4>
                    {{--<button type="button" class="btn btn-link" y-click="infopicone">示例图片</button>--}}
                </div>

            </div>
            @{{ if property==1 }}
            <div class="row companyAttr" >
                <div class="col-sm-4">
                    <div class="y-upload-img yhy-popover" data-toggle="popover" data-placement="right"
                         data-content="<ul class='popover-width'><li>身份证上的<span class='text-danger'>所有信息清晰可见</span>，必须能<span class='text-danger'>看清证件号码</span>。</li><li>照片需免冠，建议未化妆，手持证见人的<span class='text-danger'>五官清晰可见</span>。</li><li>照片内容真实有效，不得做任何修改</li><li>支持<span class='text-danger'>.jpg .jpeg .bmp .gif</span>格式照片大小<span class='text-danger'>不超过2M</span></li></ul>">
                        {{--<h1 class="y-mt60"><small>请选择文件</small></h1>--}}
                        <img src="@{{ img_license }}" class="upload-img"/>
                        {{--<input type="file" value="" name="img_license" class="inputImg"/>--}}
                    </div>
                    <h4 class="y-fs16">营业执照号</h4>
                    {{--<button type="button" class="btn btn-link" y-click="infopicone">示例图片</button>--}}
                </div>
                <div class="col-sm-4">
                    <div class="y-upload-img yhy-popover" data-toggle="popover" data-placement="right"
                         data-content="<ul class='popover-width'><li>身份证上的<span class='text-danger'>所有信息清晰可见</span>，必须能<span class='text-danger'>看清证件号码</span>。</li><li>照片需免冠，建议未化妆，手持证见人的<span class='text-danger'>五官清晰可见</span>。</li><li>照片内容真实有效，不得做任何修改</li><li>支持<span class='text-danger'>.jpg .jpeg .bmp .gif</span>格式照片大小<span class='text-danger'>不超过2M</span></li></ul>">
                        {{--<h1 class="y-mt60"><small>请选择文件</small></h1>--}}
                        <img src="@{{ img_tax }}" class="upload-img"/>
                        {{--<input type="file" value="" name="img_tax" class="inputImg"/>--}}
                    </div>
                    <h4 class="y-fs16">税务许可证</h4>

                    {{--<button type="button" class="btn btn-link" y-click="infopicone">示例图片</button>--}}
                </div>
                <div class="col-sm-4">
                    <div class="y-upload-img yhy-popover" data-toggle="popover" data-placement="right"
                         data-content="<ul class='popover-width'><li>身份证上的<span class='text-danger'>所有信息清晰可见</span>，必须能<span class='text-danger'>看清证件号码</span>。</li><li>照片需免冠，建议未化妆，手持证见人的<span class='text-danger'>五官清晰可见</span>。</li><li>照片内容真实有效，不得做任何修改</li><li>支持<span class='text-danger'>.jpg .jpeg .bmp .gif</span>格式照片大小<span class='text-danger'>不超过2M</span></li></ul>">
                        {{--<h1 class="y-mt60"><small>请选择文件</small></h1>--}}
                        <img src="@{{ img_permit }}" class="upload-img"/>
                        {{--<input type="file" value="" name="img_permit" class="inputImg"/>--}}
                    </div>
                    <h4 class="y-fs16">文网文文件(辅助文件，非必传)</h4>

                    {{--<button type="button" class="btn btn-link" y-click="infopicone">示例图片</button>--}}
                </div>
            </div>
            @{{ /if}}
        </div>
    </script>
    <script>
        $.ajax({
            url: "/api/profile/base",
            type: 'get',
//            beforeSend: function () {
//                // 加载loading
//                $("body").append("<div class='yhy-loading'><div class='spinner'><div class='bounce1'></div><div class='bounce2'></div><div class='bounce3'></div></div></div>");
//            },
            success: function (data) {
                if (filterAjaxData(data)) {
                    console.log(data);

                    var userHtml = template('userInfoM', data.data);
                    $("#userInfoList").html(userHtml);

                } else {
                    showMsg(data.message);
                }
            }
//            complete: function () {
//                $(".yhy-loading").remove();
//            }


        });
    </script>
@endsection()
